package chapter15.generator;

/**
 * @author : DuJiabao
 * @Date : 2021/3/4 11:38
 * @Project : thinking_in_java
 * @File : null.java
 * @Desc :
 */
public abstract class Coffee {
  private static long counter = 0;
  private final long id = counter++;  // 每杯咖啡都有一个独特的id

  @Override
  public String toString() {
    return getClass().getSimpleName() + " " + id;
  }
}
